home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
clipper
/
nftroff.zip
/
5.tr
< prev
next >
Wrap
Text File
|
1991-11-21
|
53KB
|
3,238 lines
.de }n
.bp
.sp .5i
..
.wh -.8i }n
.sp .5i
.po -.4i
.ll 7.5i
.ps 9
.vs 9
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_ACCTADJ() Adjust beginning or ending fiscal pd\. dates to acctg\. dates
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_ACCTADJ()
Adjust beginning or ending fiscal pd\. dates to acctg\. dates
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_ACCTADJ( [ <dGivenDate> ], [ <lIsEnd> ] ) -> dDate
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<dGivenDate>\fR is any valid date in any valid format\.
Defaults to DATE() if not supplied\.
.sp
\fB<lIsEnd>\fR is a logical variable\. \.F\. = adjust for beginning of
period mode, \.T\. = adjust for end of period mode\. Defaults to
beginning of period mode\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
An adjusted date dependent upon mode and work week start day\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
Called by other FT_ACCT\.\. functions\. The algorithm is:
.sp
Beginning of period mode:
.sp
.in 0.64i
If dGivenDate is in last 3 days of work week
.in 0.88i
Return next week\'s start date
.in 0.64i
Else
.in 0.88i
Return this week\'s start date
.in 0.64i
Endif
.sp
.in 0.4i
End of period mode:
.sp
.in 0.64i
If dGivenDate is in last 4 days of work week
.in 0.88i
Return this week\'s end date
.in 0.64i
Else
.in 0.88i
Return prior week\'s end date
.in 0.64i
Endif
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
Beginning of period mode (lIsEnd == \.F\.)
.sp
.in 0.56i
.ta 2.32i
dDate := Ctod( "01/31/91" ) // In last 3 days of work week
.br
.ta
.ta 2.32i
? FT_ACCTADJ( dDate ) // 02/03/91 (next week\'s start)
.br
.ta
.sp
.ta 2.32i
dDate := Ctod( "03/31/91" ) // Not in last 3 days of work week
.br
.ta
.ta 2.32i
? FT_ACCTADJ( dDate ) // 03/31/91 (this week\'s start)
.br
.ta
.sp
.in 0.4i
End of period mode (lIsEnd == \.T\.)
.sp
.in 0.56i
.ta 2.32i
dDate := Ctod( "01/31/91" ) // In last 4 days of work week
.br
.ta
.ta 2.32i
? FT_ACCTADJ( dDate, \.T\. ) // 02/02/91 (this week\'s end)
.br
.ta
.sp
.ta 2.32i
dDate := Ctod( "03/31/91" ) // Not in last 4 days of work week
.br
.ta
.ta 2.32i
? FT_ACCTADJ( dDate, \.T\. ) // 03/30/91 (prior week\'s end)
.br
.ta
.sp
.in 0.08i
\fBSource:\fR ACCTADJ\.PRG
.sp
\fBAuthor:\fR Jo W\. French dba Practical Computing
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_DATECNFG()
, FT_DAYTOBOW()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_ACCTMONTH() Return accounting month data
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_ACCTMONTH()
Return accounting month data
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_ACCTMONTH( [ <dGivenDate> ], [ <nMonthNum> ] ) -> aDateInfo
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<dGivenDate>\fR is any valid date in any date format\. Defaults
to current system date if not supplied\.
.sp
\fB<nMonthNum>\fR is a number from 1 to 12 signifying a month\.
Defaults to current month if not supplied\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
A three element array containing the following data:
.sp
.in 0.64i
.br
aDateInfo[1] - The year and month as a character string "YYYYMM"
.br
aDateInfo[2] - The beginning date of the accounting month
.br
aDateInfo[3] - The ending date of the accounting month
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
FT_ACCTMONTH() creates an array containing data about the
accounting month containing the given date\.
.sp
An accounting period has the following characteristics:
.sp
If the first week of the period contains 4 or more \'work\'
days, it is included in the period; otherwise, the first
week was included in the prior period\.
.sp
If the last week of the period contains 4 or more \'work\'
days it is included in the period; otherwise, the last week
is included in the next period\. This results in 13 week
\'quarters\' and 4 or 5 week \'months\'\. Every 5 or 6 years, a
\'quarter\' will contain 14 weeks and the year will contain 53
weeks\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
// get info about accounting month containing 9/15/90
.br
aDateInfo := FT_ACCTMONTH( Ctod("09/15/90") )
.ta 1.36i 1.68i 2.72i
.br
? aDateInfo[1] // 199009 (9th month)
.br
.ta
.ta 1.36i 1.68i 2.72i
.br
? aDateInfo[2] // 09/02/90 beginning of month 9
.br
.ta
.ta 1.36i 1.68i 2.72i
.br
? aDateInfo[3] // 09/29/90 end of month 9
.br
.ta
.sp
.br
// get info about accounting month 5 in year containing 9/15/90
.br
aDateInfo := FT_ACCTMONTH( Ctod("09/15/90"), 5 )
.ta 1.36i 1.68i
.br
? aDateInfo[1] // 199005
.br
.ta
.ta 1.36i 1.68i 2.56i
.br
? aDateInfo[2] // 04/29/89 beginning of month 5
.br
.ta
.ta 1.36i 1.68i 2.56i
.br
? aDateInfo[3] // 06/02/90 end of month 5
.br
.ta
.sp
.in 0.08i
\fBSource:\fR ACCTMNTH\.PRG
.sp
\fBAuthor:\fR Jo W\. French dba Practical Computing
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_DATECNFG()
, FT_ACCTWEEK()
, FT_ACCTQTR()
, FT_ACCTYEAR()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_ACCTQTR() Return accounting quarter data
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_ACCTQTR()
Return accounting quarter data
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_ACCTQTR( [ <dGivenDate> ], [ <nQtrNum> ] ) -> aDateinfo
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<dGivenDate>\fR is any valid date in any date format\. Defaults
to current system date if not supplied\.
.sp
\fB<nQtrNum>\fR is a number from 1 to 4 signifying a quarter\.
Defaults to current quarter if not supplied\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
A three element array containing the following data:
.sp
.in 0.64i
.br
aDateInfo[1] - The year and qtr\. as a character string "YYYYQQ"
.br
aDateInfo[2] - The beginning date of the accounting quarter
.br
aDateInfo[3] - The ending date of the accounting quarter
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
FT_ACCTQTR() creates an array containing data about the
accounting quarter containing the given date\.
.sp
An accounting period has the following characteristics:
.sp
If the first week of the period contains 4 or more \'work\'
days, it is included in the period; otherwise, the first
week was included in the prior period\.
.sp
If the last week of the period contains 4 or more \'work\'
days it is included in the period; otherwise, the last week
is included in the next period\. This results in 13 week
\'quarters\' and 4 or 5 week \'months\'\. Every 5 or 6 years, a
\'quarter\' will contain 14 weeks and the year will contain 53
weeks\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
// get info about accounting month containing 9/15/90
.br
aDateInfo := FT_ACCTQTR( CTOD("09/15/90") )
.ta 1.36i 1.68i 2.72i
.br
? aDateInfo[1] // 199003 (3rd quarter)
.br
.ta
.ta 1.36i 1.68i 2.72i
.br
? aDateInfo[2] // 07/01/90 beginning of quarter 3
.br
.ta
.ta 1.36i 1.68i 2.72i
.br
? aDateInfo[3] // 09/29/90 end of quarter 3
.br
.ta
.sp
.br
// get info about accounting qtr\. 2 in year containing 9/15/90
.br
aDateInfo := FT_ACCTQTR( CTOD("09/15/90"), 2 )
.ta 1.36i 1.68i
.br
? aDateInfo[1] // 199002
.br
.ta
.ta 1.36i 1.68i 2.56i
.br
? aDateInfo[2] // 04/01/89 beginning of quarter 2
.br
.ta
.ta 1.36i 1.68i 2.56i
.br
? aDateInfo[3] // 06/30/90 end of quarter 2
.br
.ta
.sp
.in 0.08i
\fBSource:\fR ACCTQTR\.PRG
.sp
\fBAuthor:\fR Jo W\. French dba Practical Computing
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_DATECNFG()
, FT_ACCTWEEK()
, FT_ACCTMONTH()
, FT_ACCTYEAR()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_ACCTWEEK() Return accounting week data
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_ACCTWEEK()
Return accounting week data
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_ACCTWEEK( [ <dGivenDate> ], [ <nWeekNum> ] ) -> aDateInfo
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<dGivenDate>\fR is any valid date in any date format\. Defaults
to current system date if not supplied\.
.sp
\fB<nWeekNum>\fR is a number from 1 to 52 signifying a week\.
Defaults to current week if not supplied\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
A three element array containing the following data:
.sp
.in 0.64i
.br
aDateInfo[1] - The year and week as a character string "YYYYWW"
.br
aDateInfo[2] - The beginning date of the accounting week
.br
aDateInfo[3] - The ending date of the accounting week
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
FT_ACCTWEEK() returns an arr